package S08.second;

import java.util.function.Function;

public class N02 {
	public static void main(String[] args) {
		Function<String, Integer> f=new Function<String, Integer>() {
			@Override
			public Integer apply(String t) {
				return t.length();
			}
		};
		Integer len = f.apply("Hello world");
		System.out.println(len);
		
		Function<String, Integer> f2=(t)->t.length(); //lamda表达式
		Integer len2 = f2.apply("Hello");
		System.out.println(len2);
	}
}
